// 阶乘
const factorial = (m, n = m) => {
  if (n === 0) {
    return 1
  }
  const result = m * factorial(m -= 1, n -= 1)
  return result
}
// 排列
const A = (m, n) => factorial(m, n)
// 组合
const C = (m, n) => factorial(m, n) / factorial(n, n)

export default {
  factorial,
  A,
  C
}
